package com.uu.safeguard.dao;

import com.uu.safeguard.entity.MemberRechargeLog;
import org.apache.ibatis.annotations.Param;

import java.util.LinkedHashMap;
import java.util.List;

/**
 * (MemberRechargeLog)表数据库访问层
 *
 * @author makejava
 * @since 2021-04-17 16:52:01
 */
public interface MemberRechargeLogDao {
    /**
     * @Description: 单号查询充值详情
     * @Param: [refundLogSn]
     **/
    LinkedHashMap<String,Object> findRechargeLogBySn(String rechargeLogSn);
    /**
     * @Description: 本月充值
     * @Param: [operatorMemberSn]
     **/
    LinkedHashMap<String,Object> findMonthRecharge(String operatorMemberSn);
    /**
     * @Description: 充值金额柱状图
     * @Param: [operatorMemberSn, projectSn]
     **/
    LinkedHashMap<String,Object> findRechargeHistogram(String operatorMemberSn,String projectSn);
    /**
     * @Description: 运营商所有项目充值数据
     * @Param: [projectSn, operatorMemberSn, startTime, endTime]
     **/
    LinkedHashMap<String,Object> findProjectsRechargeProfit(String projectSn,String operatorMemberSn, Long startTime, Long endTime);
    /**
     * @Description: 某月某日某年项目充值曲线
     * @Param: [projectSn, operatorMemberSn, startTime, endTime]
     **/
    List<LinkedHashMap<String,Object>> findProjectRechargeCurveDay(String projectSn,String operatorMemberSn, Long startTime, Long endTime);
    List<LinkedHashMap<String,Object>> findProjectRechargeCurveMonth(String projectSn,String operatorMemberSn, Long startTime, Long endTime);
    List<LinkedHashMap<String,Object>> findProjectRechargeCurveYear(String projectSn,String operatorMemberSn, Long startTime, Long endTime);
    /**
     * @Description: 某月某日某年项目充值排行
     * @Param: [operatorMemberSn, startTime, endTime, startIndex, endIndex]
     **/
    List<LinkedHashMap<String,Object>> findProjectRechargeSort(String projectSn,String operatorMemberSn, Long startTime, Long endTime, int startIndex, int endIndex);
    Integer findProjectRechargeSortCount(String projectSn,String operatorMemberSn,Long startTime,Long endTime);

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    MemberRechargeLog queryById(Integer id);

    /**
     * 查询指定行数据
     *
     * @param offset 查询起始位置
     * @param limit 查询条数
     * @return 对象列表
     */
    List<MemberRechargeLog> queryAllByLimit(@Param("offset") int offset, @Param("limit") int limit);


    /**
     * 通过实体作为筛选条件查询
     *
     * @param memberRechargeLog 实例对象
     * @return 对象列表
     */
    List<MemberRechargeLog> queryAll(MemberRechargeLog memberRechargeLog);

    /**
     * 新增数据
     *
     * @param memberRechargeLog 实例对象
     * @return 影响行数
     */
    int insert(MemberRechargeLog memberRechargeLog);

    /**
     * 修改数据
     *
     * @param memberRechargeLog 实例对象
     * @return 影响行数
     */
    int update(MemberRechargeLog memberRechargeLog);

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 影响行数
     */
    int deleteById(Integer id);

}